package toman;

import javax.persistence.CascadeType;

/**
 * This annotation is used for referring other TO or TOs. The value of this property specifies the query definition
 * for getting the referenced TO(s). If the value is encapsulated in ${} the expression between the brackets points
 * to the context TO's property whose value is taken as the query definition for the referenced TO(s). It is useful
 * when the query definition is not a string and cannot be therefore written as the value of Ref. An interesting
 * fact is that every referenced TO can be built on raw data provided by distinct query engines.
 * See ReferencingTransferObjects on the project's wiki.
 * <br>
 * User: zslajchrt
 * Date: 29.4.11
 * Time: 17:49
 */
@java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD})
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
public @interface Ref {
    String value() default "";
    CascadeType[] cascade() default {};

//    /**
//     * @return how many times the same TO class can be processed in a chain of references. It is a prevention against
//     * an infinite loop when one TO references another, which directly or indirectly references the first.
//     */
//    int depth() default 1;
}
